/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights
 * reserved. <a>http://www.cqcis.com</a>
 */
package com.cq.bd.service.impl;

import java.util.Map;

import com.cq.base.domain.Page;
import com.cq.bd.dao.SStaffDao;
import com.cq.bd.dao.jdbc.StaffJdbcDao;
import com.cq.bd.domain.SStaff;
import com.cq.bd.service.StaffService;

/**
 * @author huangmy
 * @date   2009-10-7
 */
public class StaffServiceImpl implements StaffService {
    private SStaffDao sStaffDao;
    private StaffJdbcDao staffJdbcDao;
    
    public void doCreateStaff(SStaff staff) {
        this.sStaffDao.create(staff);
    }
    
    public void doDeleteStaff(Long staffId) {
        SStaff s = this.sStaffDao.get(staffId);
        if (s != null) {
            this.sStaffDao.remove(s);
        }        
    }

    public SStaff doGetStaff(Long staffId) {
        return this.sStaffDao.get(staffId);
    }

    public void doUpdateStaff(SStaff staff) {
        this.sStaffDao.update(staff);
    }

    public Page pageStaffs(Map<String, String> filter, Map<String, String> like, Map<String, String> sort, int pageNo,
            int pageSize) {
        return this.staffJdbcDao.pageStaffs(filter, like, sort, pageNo, pageSize);
    }

    public void setSStaffDao(SStaffDao staffDao) {
        sStaffDao = staffDao;
    }

    public void setStaffJdbcDao(StaffJdbcDao staffJdbcDao) {
        this.staffJdbcDao = staffJdbcDao;
    }

}
